using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class webadmin_pages_khoadaotao_dk_list : System.Web.UI.Page
{
    public Common _common;
    public static string _ma = "";
    public DataTable catdtt;
    public DataTable catsubdtt;
    public DataTable newsddt = new DataTable();

    private void LoadHocvien(string ma)
    {
        string sql = "select * from Daotao_hoc_vien_dk where ma_khoa_hoc = '" + ma + "' ";
        DataSet set = this._common.ExeceuteDataset(sql);
        this.rpt_kdt.DataSource = set;
        this.rpt_kdt.DataBind();
        this.lbl_total.Text = set.Tables[0].Rows.Count.ToString();
    }

    protected void Page_Load(object sender, EventArgs e)
    {
        this._common = new Common();
        if (!string.IsNullOrEmpty(base.Request.Params["id"]) && !string.IsNullOrEmpty(base.Request.Params["act"]))
        {
            string str = this._common.TextFormat(base.Request.Params["id"].ToString());
            if (base.Request.Params["act"].ToString().Trim().Equals("del"))
            {
                this._common.execNoneQuery("delete Daotao_hoc_vien_dk where id = '" + str + "'");
            }
            if (base.Request.Params["act"].ToString().Trim().Equals("chon"))
            {
                int num = 1;
                if (base.Request.Params["type"].ToString().Trim().Equals("True"))
                {
                    num = 0;
                }
                this._common.execNoneQuery(string.Concat(new object[] { "update Daotao_hoc_vien_dk set chon_hoc = ", num, " where id = '", str, "'" }));
            }
        }
        if (base.Request.Params["ma"] != null)
        {
            _ma = this._common.TextFormat(base.Request.Params["ma"].ToString());
        }
        this.LoadHocvien(_ma);
    }
}
